package com.it.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;

/**
 * 项目配置类
 *  【说明】：
 *      扫描com.it路径下的包及子包将类放入IOC容器管理
 *      将handlerMapping、handlerAdapter放入IOC容器管理
 */
@Configuration
@ComponentScan("com.it")
@EnableWebMvc // 帮我们自动加上 handlerMapping、handlerAdapter、JSON转换器
public class springmvcConfig {
    @Bean
    public RequestMappingHandlerMapping handlerMapping() {
        return new RequestMappingHandlerMapping();
    }

    @Bean
    public RequestMappingHandlerAdapter handlerAdapter() {
        return new RequestMappingHandlerAdapter();
    }
}
